package com.neusoft.neuiotms.support.mongo.model;

import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Document("logs")
public class LogDocument {
    @Id
    private String id;
    /** 应用标识，由各系统负责 */
    private String app;
    /** 外部关联 */
    private String ref;
    /** 用户账号 */
    private String account;
    /** 用户名字 */
    private String username;
    /** IP地址 */
    private String ip;
    /** 操作 */
    private String operation;
    /** 调用API */
    private String api;
    /** 其它参数 */
    private String extra;
    /** 发生时间 */
    private Date time;

    @Override
    public String toString() {
        return "LogDocument{" +
                "id='" + this.id + '\'' +
                ", app='" + this.app + '\'' +
                ", account='" + this.account + '\'' +
                ", username=" + this.username +
                ", ip=" + this.ip +
                ", operation='" + this.operation + '\'' +
                ", api='" + this.api + '\'' +
                ", extra='" + this.extra + '\'' +
                ", time='" + this.time + '\'' +
                '}';
    }
}
